package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.vo.SysWhitePaperSurveyResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysWhitePaperSurveyResultMapper;
import com.ruoyi.system.domain.SysWhitePaperSurveyResult;
import com.ruoyi.system.service.ISysWhitePaperSurveyResultService;

/**
 * 白皮书调研结果Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class SysWhitePaperSurveyResultServiceImpl implements ISysWhitePaperSurveyResultService
{
    @Autowired
    private SysWhitePaperSurveyResultMapper sysWhitePaperSurveyResultMapper;

    @Override
    public List<SysWhitePaperSurveyResultVo> countSurveyResultByProjectId(Long projectId) {
        return sysWhitePaperSurveyResultMapper.countSurveyResultByProjectId(projectId);
    }

    /**
     * 查询白皮书调研结果
     *
     * @param id 白皮书调研结果主键
     * @return 白皮书调研结果
     */
    @Override
    public SysWhitePaperSurveyResult selectSysWhitePaperSurveyResultById(Long id)
    {
        return sysWhitePaperSurveyResultMapper.selectSysWhitePaperSurveyResultById(id);
    }

    /**
     * 查询白皮书调研结果列表
     *
     * @param sysWhitePaperSurveyResult 白皮书调研结果
     * @return 白皮书调研结果
     */
    @Override
    public List<SysWhitePaperSurveyResult> selectSysWhitePaperSurveyResultList(SysWhitePaperSurveyResult sysWhitePaperSurveyResult)
    {
        return sysWhitePaperSurveyResultMapper.selectSysWhitePaperSurveyResultList(sysWhitePaperSurveyResult);
    }

    /**
     * 新增白皮书调研结果
     *
     * @param sysWhitePaperSurveyResult 白皮书调研结果
     * @return 结果
     */
    @Override
    public int insertSysWhitePaperSurveyResult(SysWhitePaperSurveyResult sysWhitePaperSurveyResult)
    {
        sysWhitePaperSurveyResult.setCreateTime(DateUtils.getNowDate());
        return sysWhitePaperSurveyResultMapper.insertSysWhitePaperSurveyResult(sysWhitePaperSurveyResult);
    }

    /**
     * 修改白皮书调研结果
     *
     * @param sysWhitePaperSurveyResult 白皮书调研结果
     * @return 结果
     */
    @Override
    public int updateSysWhitePaperSurveyResult(SysWhitePaperSurveyResult sysWhitePaperSurveyResult)
    {
        sysWhitePaperSurveyResult.setUpdateTime(DateUtils.getNowDate());
        return sysWhitePaperSurveyResultMapper.updateSysWhitePaperSurveyResult(sysWhitePaperSurveyResult);
    }

    /**
     * 批量删除白皮书调研结果
     *
     * @param ids 需要删除的白皮书调研结果主键
     * @return 结果
     */
    @Override
    public int deleteSysWhitePaperSurveyResultByIds(Long[] ids)
    {
        return sysWhitePaperSurveyResultMapper.deleteSysWhitePaperSurveyResultByIds(ids);
    }

    /**
     * 删除白皮书调研结果信息
     *
     * @param id 白皮书调研结果主键
     * @return 结果
     */
    @Override
    public int deleteSysWhitePaperSurveyResultById(Long id)
    {
        return sysWhitePaperSurveyResultMapper.deleteSysWhitePaperSurveyResultById(id);
    }

    @Override
    public void batchInsertSysWhitePaperSurveyResult(List<SysWhitePaperSurveyResult> whitePaperSurveyResultList) {
        sysWhitePaperSurveyResultMapper.batchInsertSysWhitePaperSurveyResult(whitePaperSurveyResultList);
    }
}
